package com.zzmm.socket.demo;

import lombok.SneakyThrows;
import org.junit.Test;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressTest {


    public static void main(String[] args) throws UnknownHostException {
        
    }

    @SneakyThrows
    @Test
    public void testInetAddress(){
        InetAddress localHost = InetAddress.getLocalHost();
        System.out.println("localHost = " + localHost);
        InetAddress byName = InetAddress.getByName("www.baidu.com");
        System.out.println("byName = " + byName);
    }

}
